// 课程数据 - 根据courses表结构构造
const coursesData = [
    // computer类课程
    {
        id: 1,
        title: 'Introduction to Python Programming Fundamentals',
        description: 'Learn Python from scratch, from environment setup to project implementation, master programming thinking and basic syntax',
        courseIntro: 'This course is designed for beginners in programming, starting with basic Python syntax and covering core concepts such as variables, data types, control structures, and functions. Through practical cases and small projects, it helps students quickly master programming thinking. The course adopts a gradual teaching method, combined with a large amount of practice, enabling students to independently complete simple program development and lay a solid foundation for subsequent learning.',
        teacher_id: 1,
        category_id: 2, // computer
        cover_image: '../Homepage/images/courses/cs-1.jpg',
        status: 'published',
        enableNotes:'open',
        enableComments:'open',
        created_at: '2025-01-15T09:00:00.000Z',
        updated_at: '2025-01-20T14:30:00.000Z',
        category: 'computer',
        teacher: 'Professor Zhang Wei',
        registerCount: 1580,
        teacherEmail: 'zhangwei@example.com',
        likes: 245,
        recommend: true,
        carouselImages: ['../Homepage/images/courses/cs-1.jpg'],
        teachingPlan: "Teaching Plan Content",
        catalog: "Table of Contents Chapter Content",
        assessmentStandard: "Assessment criteria content"
    },
    {
        id: 2,
        title: 'Practical experience in web front-end development',
        description: 'Essential skills for full stack development, with comprehensive mastery of HTML5, CSS3, JavaScript, and Vue.js frameworks',
        courseIntro: 'This course systematically explains modern web front-end development techniques, from HTML5 semantic tags, CSS3 style design to JavaScript programming basics, and finally delves into Vue.js framework applications. Through practical projects such as e-commerce websites and management backends, students will master core skills such as responsive layout, component-based development, and front-end engineering, and have the ability to independently develop enterprise level front-end applications.',
        teacher_id: 2,
        category_id: 2,
        cover_image: '../Homepage/images/courses/cs-2.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-10T10:00:00.000Z',
        updated_at: '2025-01-25T16:45:00.000Z',
        category: 'computer',
        teacher: 'Teacher Li Ming',
        registerCount: 2150,
        recommend: true,
        carouselImages: ['../Homepage/images/courses/cs-2.jpg']
    },
    {
        id: 3,
        title: 'Data Structures and Algorithms',
        description: 'Core courses in computer science, with a deep understanding of algorithmic thinking, enhancing programming skills and logical thinking',
        courseIntro: 'This course comprehensively explains classic data structures and algorithms in computer science, including data structures such as arrays, linked lists, trees, graphs, as well as commonly used algorithms such as sorting, searching, and dynamic programming. By combining theoretical explanation with programming practice, we help students establish a systematic algorithmic thinking system, enhance their ability to solve complex problems, and lay a solid foundation for technical interviews and career development.',
        teacher_id: 3,
        category_id: 2,
        cover_image: '../Homepage/images/courses/cs-3.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-08T14:00:00.000Z',
        updated_at: '2025-01-22T11:20:00.000Z',
        category: 'computer',
        teacher: 'Professor Wang',
        registerCount: 980,
        recommend: false,
        carouselImages: ['../Homepage/images/courses/cs-3.jpg']
    },

    // Science and Engineering类课程  
    {
        id: 4,
        title: 'Advanced Mathematics (Calculus)',
        description: 'College Mathematics Fundamentals Core Course, Limit, Derivative, Integral Theory and Applications',
        courseIntro: 'This course systematically explains the theory of calculus of univariate functions, including core concepts such as limits, derivatives, differentials, integrals, and their applications. By combining geometric intuition with theoretical deduction, this teaching method helps students understand the essence of mathematics, master the basic methods of calculus, cultivate abstract thinking and logical reasoning abilities, and provide necessary mathematical tools for subsequent professional course learning.',
        teacher_id: 4,
        category_id: 1,
        cover_image: '../Homepage/images/courses/math-1.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-05T08:30:00.000Z',
        updated_at: '2025-01-18T13:15:00.000Z',
        category: 'Science and Engineering',
        teacher: 'Professor Chen Mathematics',
        registerCount: 1200,
        recommend: true,
        carouselImages: ['../Homepage/images/courses/math-1.jpg']
    },
    {
        id: 5,
        title: 'Linear Algebra and Spatial Analytic Geometry',
        description: 'Matrix operations, vector spaces, eigenvalues and eigenvectors, fundamentals of engineering mathematics',
        courseIntro: 'This course introduces the basic concepts and methods of linear algebra, including matrix operations, vector spaces, linear transformations, and eigenvalue problems. It also combines knowledge of spatial analytic geometry to cultivate students' algebraic calculation and geometric intuition abilities. The course emphasizes the combination of theory and application, laying a mathematical foundation for in-depth learning in fields such as computer graphics and machine learning.',
        teacher_id: 5,
        category_id: 1,
        cover_image: '../Homepage/images/courses/math-2.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-12T09:45:00.000Z',
        updated_at: '2025-01-28T15:30:00.000Z',
        category: 'Science and Engineering',
        teacher: 'Teacher Zhao Geometry',
        registerCount: 890,
        recommend: false,
        carouselImages: ['../Homepage/images/courses/math-2.jpg']
    },

    // Education and Language类课程
    {
        id: 6,
        title: 'Intensive Reading',
        description: 'Enhance English reading comprehension ability, master vocabulary and grammar, and cultivate English thinking',
        courseIntro: 'This course systematically trains students' reading comprehension ability through selected English articles, while expanding vocabulary and consolidating grammar knowledge. The course covers multiple fields such as literature, technology, and economics, using a combination of intensive and extensive reading to help students improve their comprehensive English application skills, cultivate cross-cultural communication awareness, and lay a language foundation for academic research and career development.',
        teacher_id: 6,
        category_id: 3,
        cover_image: '../Homepage/images/courses/lang-1.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-03T11:00:00.000Z',
        updated_at: '2025-01-26T10:45:00.000Z',
        category: 'Education and Language',
        teacher: 'Teacher Susan',
        registerCount: 1680,
        recommend: true,
        carouselImages: ['../Homepage/images/courses/lang-1.jpg']
    },
    {
        id: 7,
        title: 'Introduction to Japanese with zero foundation',
        description: 'Starting from the fifty tone chart, basic grammar, daily conversations, and easy entry into Japanese language learning',
        courseIntro: 'This course is aimed at Japanese language learners with zero foundation, starting with the pronunciation of the fifty tone chart and gradually explaining basic grammar and daily conversations. Through situational dialogues and cultural background introductions, help students quickly master practical expressions such as greetings, shopping, and asking for directions, understand Japanese cultural customs, cultivate basic communication skills, and lay a good foundation for future Japanese language learning.',
        teacher_id: 7,
        category_id: 3,
        cover_image: '../Homepage/images/courses/lang-2.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-14T13:20:00.000Z',
        updated_at: '2025-01-29T17:10:00.000Z',
        category: 'Education and Language',
        teacher: 'Teacher Tanaka',
        registerCount: 750,
        recommend: false,
        carouselImages: ['../Homepage/images/courses/lang-2.jpg']
    },

    // Literature and Art类课程
    {
        id: 8,
        title: 'Appreciation of Ancient Chinese Literature',
        description: 'Appreciating classic poetry and songs, experiencing the charm of Chinese culture, and enhancing literary literacy',
        courseIntro: 'This course selects classic works of ancient Chinese literature, from the Book of Songs and Chu Ci to Tang poetry, Song lyrics, and Ming and Qing novels. Through careful reading of texts and background analysis, it guides students to deeply understand the ideological connotations and artistic characteristics of the works. The course emphasizes the combination of literature and history, showcasing the profoundness of Chinese culture while appreciating literary works, and enhancing students' humanistic literacy and aesthetic ability.',
        teacher_id: 8,
        category_id: 4,
        cover_image: '../Homepage/images/courses/lit-1.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-07T15:30:00.000Z',
        updated_at: '2025-01-24T12:00:00.000Z',
        category: 'Literature and Art',
        teacher: 'Professor Li Wen',
        registerCount: 620,
        recommend: false,
        carouselImages: ['../Homepage/images/courses/lit-1.jpg']
    },
    {
        id: 9,
        title: 'Introduction to Modern Painting Techniques',
        description: 'From sketching basics to color matching, cultivate artistic aesthetics and creative abilities',
        courseIntro: 'This course systematically introduces the basic techniques of modern painting, including sketch modeling, color theory, and composition principles. Through practical training such as still life sketching and landscape painting, help students master the basic language of painting, cultivate artistic perception and creativity. The course emphasizes the cultivation of observation and expression abilities, laying the foundation for art major learning or amateur creation.',
        teacher_id: 9,
        category_id: 4,
        cover_image: '../Homepage/images/courses/art-1.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-16T10:15:00.000Z',
        updated_at: '2025-01-30T14:25:00.000Z',
        category: 'Literature and Art',
        teacher: 'Teacher Zhang Yi',
        registerCount: 480,
        recommend: false,
        carouselImages: ['../Homepage/images/courses/art-1.jpg']
    },

    // Entrepreneurship and Workplace类课程
    {
        id: 10,
        title: 'Entrepreneurial Management and Business Models',
        description: 'From 0 to 1 entrepreneurial guidance, writing business plans, financing strategies, and team management',
        courseIntro: 'This course systematically explains the entire process of entrepreneurship, from creative screening and market analysis to business model design, team building, and financing strategies. Through real case analysis and practical exercises, help students master core entrepreneurial skills, understand entrepreneurial risks and opportunities, learn to write business plans and conduct roadshows, and improve their entrepreneurial success rate and business management capabilities.',
        teacher_id: 10,
        category_id: 5,
        cover_image: '../Homepage/images/courses/cs-1.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-11T09:30:00.000Z',
        updated_at: '2025-01-27T16:20:00.000Z',
        category: 'Entrepreneurship and Workplace',
        teacher: 'Liu Entrepreneurship Mentor',
        registerCount: 850,
        recommend: true,
        carouselImages: ['../Homepage/images/courses/cs-1.jpg']
    },
    {
        id: 11,
        title: 'Workplace communication and team collaboration',
        description: 'Enhance workplace soft power, master communication skills, and create efficient teamwork',
        courseIntro: 'This course is designed for professionals in the workplace, systematically explaining the core principles and practical skills of workplace communication, including common scenarios such as upward communication, cross departmental collaboration, and meeting hosting. Through role-playing and case analysis, help students improve their communication, listening, and conflict resolution skills, establish efficient teamwork relationships, and promote career development.',
        teacher_id: 11,
        category_id: 5,
        cover_image: '../Homepage/images/courses/cs-2.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-19T14:45:00.000Z',
        updated_at: '2025-02-01T11:30:00.000Z',
        category: 'Entrepreneurship and Workplace',
        teacher: 'Wang Communication Expert',
        registerCount: 720,
        recommend: false,
        carouselImages: ['../Homepage/images/courses/cs-2.jpg']
    },

    // Philosophy, History, and Culture类课程
    {
        id: 12,
        title: 'General History of China: From Ancient to Modern Times',
        description: 'Looking at the 5000 year history of China, understanding the historical development and cultural inheritance',
        courseIntro: 'This course systematically outlines the development of Chinese history, from ancient times to the Ming and Qing dynasties, and then to modern historical changes. Through the explanation of major historical events, important figures, and laws and regulations, help students establish a systematic historical knowledge framework, understand the continuation and changes of Chinese civilization, cultivate historical thinking ability and cultural identity.',
        teacher_id: 12,
        category_id: 6,
        cover_image: '../Homepage/images/courses/hist-1.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-06T11:20:00.000Z',
        updated_at: '2025-01-23T15:40:00.000Z',
        category: 'Philosophy, History, and Culture',
        teacher: 'Professor Shi',
        registerCount: 950,
        recommend: false,
        carouselImages: ['../Homepage/images/courses/hist-1.jpg']
    },
    {
        id: 13,
        title: 'Introduction to the History of Western Philosophy',
        description: 'From ancient Greece to modern times, sorting out the development of Western philosophy and contemplating the wisdom of life',
        courseIntro: 'This course introduces the development process of Western philosophy, from ancient Greek philosophy to modern philosophical trends. Through the interpretation of the core ideas and classic texts of major philosophers, it guides students to think about basic philosophical issues such as existence, knowledge, and value. The course focuses on cultivating critical thinking and independent thinking abilities, helping students establish a philosophical perspective, and deepen their understanding of life and the world.',
        teacher_id: 13,
        category_id: 6,
        cover_image: '../Homepage/images/courses/hist-2.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-17T12:10:00.000Z',
        updated_at: '2025-01-31T09:50:00.000Z',
        category: 'Philosophy, History, and Culture',
        teacher: 'Master of Philosophy',
        registerCount: 430,
        recommend: false,
        carouselImages: ['../Homepage/images/courses/hist-2.jpg']
    },

    // Economy and Management类课程
    {
        id: 14,
        title: 'Principles of Microeconomics',
        description: 'Market mechanism, supply-demand relationship, consumer behavior, basic economic theories',
        courseIntro: 'This course systematically explains the basic principles of microeconomics, including supply and demand theory, consumer choice, producer behavior, and market structure. By analyzing theoretical models and real-life cases, we aim to help students understand the laws of market economy operation, master economic thinking, and be able to use economic tools to analyze practical problems, laying a foundation for their future professional learning and career development.',
        teacher_id: 14,
        category_id: 7,
        cover_image: '../Homepage/images/courses/math-1.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-09T08:45:00.000Z',
        updated_at: '2025-01-25T13:25:00.000Z',
        category: 'Economy and Management',
        teacher: 'in economics',
        registerCount: 1100,
        recommend: true,
        carouselImages: ['../Homepage/images/courses/math-1.jpg']
    },
    {
        id: 15,
        title: 'modern enterprise management',
        description: 'Organizational behavior, strategic planning, and human resource management to comprehensively enhance management capabilities',
        courseIntro: 'This course systematically introduces the basic theories and practical methods of modern enterprise management, covering topics such as strategic management, organizational design, human resources, and operational management. Through case analysis and practical exercises, help students master the core skills of enterprise management, understand the entire process of enterprise operation, enhance management decision-making ability and leadership, and prepare for future management work.',
        teacher_id: 15,
        category_id: 7,
        cover_image: '../Homepage/images/courses/math-2.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-13T10:30:00.000Z',
        updated_at: '2025-01-28T14:15:00.000Z',
        category: 'Economy and Management',
        teacher: 'management experts',
        registerCount: 820,
        recommend: false,
        carouselImages: ['../Homepage/images/courses/math-2.jpg']
    },

    // medicine类课程
    {
        id: 16,
        title: 'Fundamentals of Human Anatomy',
        description: 'Systematically studying the structure of various organ systems in the human body, a compulsory basic course for medical majors',
        courseIntro: 'This course systematically explains the morphological structure, positional relationships, and functional characteristics of various organ systems in the human body. Through a combination of theoretical lectures and specimen observations, it helps students establish a complete knowledge system of human body structure. The course emphasizes the connection between structure and function, highlights the clinical application value, and lays a solid foundation for the subsequent study of medical courses such as physiology and pathology.',
        teacher_id: 16,
        category_id: 8,
        cover_image: '../Homepage/images/courses/cs-3.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-04T07:30:00.000Z',
        updated_at: '2025-01-21T16:45:00.000Z',
        category: 'medicine',
        teacher: 'professor of medicine',
        registerCount: 650,
        recommend: false,
        carouselImages: ['../Homepage/images/courses/cs-3.jpg']
    },
    {
        id: 17,
        title: 'Pharmacology',
        description: 'Drug mechanism of action, pharmacokinetics, clinical medication guidance',
        courseIntro: 'This course introduces the basic laws of drug body interactions, including pharmacokinetics, metabolomics, and clinical applications. Through theoretical explanations and case analysis, help students understand the mechanisms of action, therapeutic effects, and adverse reactions of various drugs, master the principles of rational drug use, and provide theoretical basis for clinical practice and drug development work.',
        teacher_id: 17,
        category_id: 8,
        cover_image: '../Homepage/images/courses/lit-2.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-18T13:40:00.000Z',
        updated_at: '2025-02-02T10:20:00.000Z',
        category: 'medicine',
        teacher: 'Pharmacological experts',
        registerCount: 380,
        recommend: false,
        carouselImages: ['../Homepage/images/courses/lit-2.jpg']
    },

    // 更多热门课程
    {
        id: 18,
        title: 'Artificial Intelligence and Machine Learning',
        description: 'Deep learning, neural networks, AI application development, mastering cutting-edge technologies',
        courseIntro: 'This course systematically explains the core algorithms and application practices of artificial intelligence and machine learning, including supervised learning, unsupervised learning, and deep neural networks. Implementing classic algorithms through Python programming and completing practical projects such as image recognition and natural language processing, helping students master AI technology principles and development methods, laying a foundation for engaging in artificial intelligence related work.',
        teacher_id: 18,
        category_id: 2,
        cover_image: '../Homepage/images/courses/cs-1.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-20T15:00:00.000Z',
        updated_at: '2025-02-03T12:30:00.000Z',
        category: 'computer',
        teacher: 'AI experts',
        registerCount: 2800,
        recommend: true,
        carouselImages: ['../Homepage/images/courses/cs-1.jpg']
    },
    {
        id: 19,
        title: 'Big data analysis and visualization',
        description: 'Practical application of Python data analysis, statistical modeling, and data visualization techniques',
        courseIntro: 'This course starts with the basics of Python data processing and systematically introduces data cleaning, statistical analysis, machine learning, and visualization techniques. Through project practice on real datasets, help students master the full process skills from data acquisition to insight discovery, and be able to use data analysis tools to solve practical problems, preparing them for careers such as data analysts and business intelligence.',
        teacher_id: 19,
        category_id: 2,
        cover_image: '../Homepage/images/courses/cs-2.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-22T11:15:00.000Z',
        updated_at: '2025-02-04T14:50:00.000Z',
        category: 'computer',
        teacher: 'Data scientist',
        registerCount: 1950,
        recommend: true,
        carouselImages: ['../Homepage/images/courses/cs-2.jpg']
    },
    {
        id: 20,
        title: 'Blockchain Technology and Applications',
        description: 'Distributed systems, smart contracts, cryptocurrencies, core blockchain technology',
        courseIntro: 'This course provides an in-depth explanation of the principles and application development of blockchain technology, including core concepts such as distributed ledgers, consensus mechanisms, and smart contracts. Through practical operation on the Ethereum platform, help students master Solidity language and DApp development methods, understand the application scenarios of blockchain in finance, supply chain and other fields, and lay a technical foundation for entering the blockchain industry.',
        teacher_id: 20,
        category_id: 2,
        cover_image: '../Homepage/images/courses/cs-3.jpg',
        status: 'published',
        enableComments:'open',
        enableNotes:'open',
        created_at: '2025-01-25T16:20:00.000Z',
        updated_at: '2025-02-05T09:40:00.000Z',
        category: 'computer',
        teacher: 'Blockchain expert',
        registerCount: 1320,
        recommend: false,
        carouselImages: ['../Homepage/images/courses/cs-3.jpg']
    }
];

// 分类数据
const categoriesData = [
    { id: 1, name: 'Science and Engineering', description: 'Basic disciplines such as mathematics, physics, chemistry, engineering, etc' },
    { id: 2, name: 'computer', description: 'Computer related courses such as programming, software development, and artificial intelligence' },
    { id: 3, name: 'Education and Language', description: 'Foreign language learning, educational theory, language and literature, etc' },
    { id: 4, name: 'Literature and Art', description: 'Literature, art, design, creation and other humanities and arts categories' },
    { id: 5, name: 'Entrepreneurship and Workplace', description: 'Entrepreneurship guidance, vocational skills, business management, etc' },
    { id: 6, name: 'Philosophy, History, and Culture', description: 'Philosophy, history, cultural studies, etc' },
    { id: 7, name: 'Economy and Management', description: 'Business courses such as economics, management, finance, etc' },
    { id: 8, name: 'medicine', description: 'Medical fundamentals, clinical medicine, pharmacy and other medical related fields' }
];

// 教师数据
const teachersData = [
    { id: 1, name: 'Professor Zhang Wei', avatar: '../header-footer/images/ico.jpg', department: 'Computer Science and Technology' },
    { id: 2, name: 'Teacher Li Ming', avatar: '../header-footer/images/ico.jpg', department: 'software engineering' },
    { id: 3, name: 'Professor Wang', avatar: '../header-footer/images/ico.jpg', department: 'Computer Science and Technology' },
    { id: 4, name: 'Professor Chen Mathematics', avatar: '../header-footer/images/ico.jpg', department: 'School of mathematics and statistics' },
    { id: 5, name: 'Teacher Zhao Geometry', avatar: '../header-footer/images/ico.jpg', department: 'School of mathematics and statistics' },
    { id: 6, name: 'Teacher Susan', avatar: '../header-footer/images/ico.jpg', department: 'School of Foreign Languages' },
    { id: 7, name: 'Teacher Tanaka', avatar: '../header-footer/images/ico.jpg', department: 'School of Foreign Languages' },
    { id: 8, name: 'Professor Li Wen', avatar: '../header-footer/images/ico.jpg', department: 'School of Literature' },
    { id: 9, name: 'Teacher Zhang Yi', avatar: '../header-footer/images/ico.jpg', department: 'college of art' },
    { id: 10, name: 'Liu Entrepreneurship Mentor', avatar: '../header-footer/images/ico.jpg', department: 'Business School' },
    { id: 11, name: 'Wang Communication Expert', avatar: '../header-footer/images/ico.jpg', department: 'School of Management' },
    { id: 12, name: 'Professor Shi', avatar: '../header-footer/images/ico.jpg', department: 'School of history' },
    { id: 13, name: 'Master of Philosophy', avatar: '../header-footer/images/ico.jpg', department: 'department of philosophy' },
    { id: 14, name: 'in economics', avatar: '../header-footer/images/ico.jpg', department: 'School of Economics' },
    { id: 15, name: 'management experts', avatar: '../header-footer/images/ico.jpg', department: 'School of Management' },
    { id: 16, name: 'professor of medicine', avatar: '../header-footer/images/ico.jpg', department: 'medical school' },
    { id: 17, name: 'Pharmacological experts', avatar: '../header-footer/images/ico.jpg', department: 'college of pharmacy' },
    { id: 18, name: 'AI experts', avatar: '../header-footer/images/ico.jpg', department: 'College of Artificial Intelligence' },
    { id: 19, name: 'Data scientist', avatar: '../header-footer/images/ico.jpg', department: 'Computer Science and Technology' },
    { id: 20, name: 'Blockchain expert', avatar: '../header-footer/images/ico.jpg', department: 'Computer Science and Technology' }
];


// 初始化数据到IndexedDB的函数
async function initCoursesData() {
    if (!db) {
        console.error('Database not initialized');
        return;
    }

    try {
        // 清空现有数据（可选）
        const transaction = db.transaction(['courses'], 'readwrite');
        const store = transaction.objectStore('courses');
        
        // 检查是否已有数据
        const countRequest = store.count();
        console.log(coursesData)
        countRequest.onsuccess = function() {
            if (countRequest.result === 0) {
                // 如果没有数据，则添加课程数据
                coursesData.forEach(course => {
                    store.add(course);
                });
                console.log('Course data initialization completed');
            } else {
                console.log('Course data already exists, skip initialization');
            }
        };
    } catch (error) {
        console.error('Failed to initialize course data:', error);
    }
}


// 导出数据
window.coursesData = coursesData;
window.categoriesData = categoriesData;
window.teachersData = teachersData;
window.initCoursesData = initCoursesData;

// window.commentsData = commentsData;



